<?php
/**
 * @ClassName: Demothree
 * @Description: TODO
 * @author: wmsh
 * @Date: 2024-05-29 17:16
 * @Version: V1.0.0
 */

namespace app\test\controller;

class Demothree
{
    protected $noNeedLogin = ['*'];

    public function index()
    {
        $startTime = '2024-05-01 15:37:29';
        $endTime = '2024-05-20 16:44:24';
        $arr1 = calc_time_diff($startTime);
        var_dump($startTime . "至今相距" . $arr1['day'] . "天" . $arr1['hour'] . "时" . $arr1['minute'] . "分" . $arr1['second'] . "秒");
        $arr2 = calc_time_diff($startTime, $endTime);
        var_dump($startTime . "和" . $endTime . "相距" . $arr2['day'] . "天" . $arr2['hour'] . "时" . $arr2['minute'] . "分" . $arr2['second'] . "秒");

        $aes_key = generateAESKey();
        $data = [
            'reqJournalNo' => time(),
            'reqTime' => date('YmdHis'),
            'mobileNo' => createPhoneNumber(),
            'saleOrderAmount' => '0',
            'businessCode' => 'YKZ2738',
        ];
        $encrypted = encrypt(json_encode($data), $aes_key, true);
        var_dump("加密数据：" . $encrypted);

        $decrypted = decrypt($encrypted, $aes_key, true);
        var_dump("解密数据：" . $decrypted);
    }

}